<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>文件上传</title>
<link rel="stylesheet" type="text/css" href="../../ext3/css/ext-all.css" />
<script type="text/javascript" src="../../ext3/ext-base-debug.js"></script>
<script type="text/javascript" src="../../ext3/ext-all-debug.js"></script>
<script type="text/javascript" src="../../ext3/ext-lang-zh_CN.js"></script>
<script src="../../js/commons/upFile.js"></script>
<script src="../../js/commons/linkButton.js"></script>
<script src="../../js/commons/imgTools.js"></script>
</head>
<body>
<script>
var upFile = new Ext.sw.upFile({
	width:300,
	height:150,
	url:'../../upFile.do',
	closeAction : "hide",
	urlCallback:function(val){
		form.getForm().setValues({logo:val})
	}
});

var imgWin = new Ext.sw.ImageWin();
var imgDefWin = new Ext.sw.ImageWin({defSrc:"http://localhost:8000/ext/upImg/2c908fe33122978e01312b54be9600c1.jpg"});

var form = new Ext.form.FormPanel({
	title:'文件上传',
	frame:true,
	items:[
			{
				xtype:'button',
				text:'upFile',
				handler:function(){
					upFile.show();
				}
			},{
				xtype:'textfield',
				name:'logo',
				fieldLabel:'上传图片内容'
			},{
				xtype:'button',
				text:'没有缺省图片+正确Url',
				listeners:{
					"click":function(){
						imgWin.setSrc('http://localhost:8000/ext/upImg/111.JPG');
						imgWin.show();
					}
				}
			},{
				xtype:'button',
				text:'没有缺省图片+错误Url',
				listeners:{
					"click":function(){
						imgWin.setSrc('http://localhost:8000/ext/upImg/1111.JPG');
						imgWin.show();
					}
				}
			},{
				xtype:'button',
				text:'缺省图片+正确Url',
				listeners:{
					"click":function(){
						imgDefWin.setSrc('http://localhost:8000/ext/upImg/111.JPG');
						imgDefWin.show();
					}
				}
			},{
				xtype:'button',
				text:'缺省图片+错误Url',
				listeners:{
					"click":function(){
						imgDefWin.setSrc('http://localhost:8000/ext/upImg/1111.JPG');
						imgDefWin.show();
					}
				}
			},{
				xtype:'button',
				text:'后退',
				listeners:{
					"click":function(){
						window.location.href="../../index.html";
					}
				}
			}]
});
		Ext.onReady(function(){
			Ext.QuickTips.init();
			Ext.form.Field.prototype.msgTarget='side';
			var viewport = new Ext.Viewport({
				items:[form]
			});
		});
	</script>
</body>
</html>